home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / wasm223.zip / MESSAGE2.ASM < prev    next >
Assembly Source File  |  1993-05-04  |  2KB  |  57 lines

  1. ;***********************************************;
  2. ; WASM Message Module, Error Output             ;
  3. ; By Eric Tauck                                 ;
  4. ;                                               ;
  5. ; Defines:                                      ;
  6. ;                                               ;
  7. ;   MesErr   message to error output            ;
  8. ;   MesErrL  message plus CR+LF to error output ;
  9. ;***********************************************;
  10.  
  11.         jmps    _message2_end
  12.  
  13. _mes_crlf       DB      13, 10, 0       ;CR+LF ASCIIZ string
  14.  
  15. ;========================================
  16. ; Display an ASCIIZ string to error
  17. ; output.
  18. ;
  19. ; In: AX= string address.
  20.  
  21. MesErr  PROC    NEAR
  22.  
  23. ;--- determine length of string
  24.  
  25.         mov     bx, ax          ;address in BX
  26.         jmps    _mgerr2         ;enter loop
  27. _mgerr1 inc     bx              ;increment address
  28. _mgerr2 cmp     BYTE [bx], 0    ;check if end of string
  29.         jnz     _mgerr1         ;loop back if not
  30.  
  31. ;--- write bytes to error device
  32.  
  33.         mov     dx, ax          ;address in DX
  34.         mov     cx, bx          ;end address in CX
  35.         sub     cx, dx          ;bytes to write
  36.         mov     bx, 2           ;error device handle
  37.         mov     ah, 40H         ;write function
  38.         int     21H             ;execute
  39.         ret
  40.         ENDP
  41.  
  42. ;========================================
  43. ; Display an ASCIIZ string followed by a
  44. ; carriage return and linefeed to error
  45. ; output.
  46. ;
  47. ; In: AX= string address.
  48.  
  49. MesErrL PROC    NEAR
  50.         call    MesErr                  ;display string
  51.         mov     ax, OFFSET _mes_crlf    ;address of CR+LF
  52.         call    MesErr                  ;display
  53.         ret
  54.         ENDP
  55.  
  56. _message2_end
  57.